#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
    int second = 0;
    int h, m, s;
    scanf("%d", &second);
    h = second / 3600;
    m = (second % 3600) / 60;
    s = (second % 3600) % 60;
    printf("%d %d %d", h, m, s);
    return 0;
}